﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Shapes;
using WTwitter.ViewModel;

namespace WTwitter.View {
	/// <summary>
	/// GeneralView.xaml の相互作用ロジック
	/// </summary>
	public partial class GeneralView : Window {
		private ClosableViewModelBase _vm;

		public GeneralView(ClosableViewModelBase target) {
			_vm = target;
			target.RequestClose += this.OnCloseRequested;
			DataContext = target;
			InitializeComponent();
		}

		private void OnCloseRequested(object sender, EventArgs e) {
			_vm.RequestClose -= this.OnCloseRequested;
			this.Close();
		}
	}
}
